﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

using Meqs.Entity;
using Meqs.Logic.Interface;
using Sunrise.Spell;


public partial class School_ClassList : System.Web.UI.Page
{
    //protected List<ClsInfo> listTable = null;

    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!IsPostBack)
        //{
        //    listTable = InitClassList();
        //}
    }

    //获取全部
    [System.Web.Services.WebMethod]
    public static List<ClsInfo> InitClassList()
    {
        Hashtable table = new Hashtable();
        table.Add("SchoolMark", Common.GetConstSchoolMark());
        table.Add("IsEffect", 1);

        IClsInfoLogic classLogic = Container<IClsInfoLogic>.Instance;
        List<ClsInfo> classList = (List<ClsInfo>)classLogic.FindAll(table);

        return classList;
    }

    //获取当前学校的性质
    [System.Web.Services.WebMethod]
    public static int GetSchoolType()
    {
        Hashtable ht = new Hashtable();
        ht.Add("SchoolMark", Common.GetConstSchoolMark());

        List<SchoolInfo> list = (List<SchoolInfo>)Container<ISchoolInfoLogic>.Instance.FindAll(ht);

        //判断是否存在纪录，并且存在大于0的值

        if (list.Count > 0 && list[0].SchoolOpt > 0)
            return list[0].SchoolOpt;
        else
            return -1;
    }
}
